<?php
/*
 * @Descripttion: 
 * @version: v1
 * @Author: Terry
 * @Date: 2021-10-04 11:47:57
 * @LastEditors: Terry
 * @LastEditTime: 2024-12-05 08:33:12
 */
// 中间件配置
return [
    // 别名或分组
    'alias'    => [
        //检查用户是否登陆/token是否有效
        'checkLogin' => app\middleware\CheckLogin::class,
        //检查用户权限
        'checkAuth' => app\middleware\CheckAuth::class,
        //用户数据隔离
        'getAuthWhere' => app\middleware\GetAuthWhere::class,
        //检查数据
        'checkData' => app\middleware\CheckData::class,
        //加密数据
        'dataEncryption' => app\middleware\DataEncryption::class,
        //检查第三方接口数据
        'checkOpenApiData' =>  app\openApi\middleware\CheckData::class,
        //检查第三方接口token
        'checkOpenApiToken' =>  app\openApi\middleware\CheckToken::class,
    ],
    // 优先级设置，此数组中的中间件会按照数组中的顺序优先执行
    'priority' => [
        //检查用户是否登陆/token是否有效
        app\middleware\CheckLogin::class,
        //检查用户权限
        app\middleware\CheckAuth::class,
        //用户数据隔离
        app\middleware\GetAuthWhere::class,
        //检查数据
        app\middleware\CheckData::class,
        //加密数据
        app\middleware\DataEncryption::class,
        //检查第三方接口token
        app\openApi\middleware\CheckToken::class,
        // 检查第三方接口数据
        app\openApi\middleware\CheckData::class,
    ],
];
